package com.sdkx.app.util;


/**
* XmlTool.java
* 版权所有(C) 2012
* 创建:cuiran 2012-9-19 下午3:39:40
*/

import android.text.TextUtils;
import android.util.Xml;

import org.xmlpull.v1.XmlPullParser;

import java.io.InputStream;

/**
 * TODO
 * @author cuiran
 * @version TODO
 */
public class xmlutil {
    //得到XML解析器
    XmlPullParser pullParser = Xml.newPullParser();
//    InputStream is = getAssets().open("activity_main.xml");
//            pullParser.setInput(is, "utf-8");
//    //得到事件类型
//    int eventType = pullParser.getEventType();
//    //文档的末尾
//    //遍历内部的内容
//    StringBuilder stringBuilder = new StringBuilder();
//            while (eventType != XmlPullParser.END_DOCUMENT) {
//        String name = pullParser.getName();
//        if (!TextUtils.isEmpty(name))
//            if (eventType == XmlPullParser.START_TAG) {
//                String attributeValue = pullParser.getAttributeValue(null, "id");
//                attributeValue = attributeValue.substring(attributeValue.indexOf("/") + 1, attributeValue.length());
//
//                stringBuilder.append("name====");
//                stringBuilder.append(name);
//                stringBuilder.append("\t\tid====");
//                stringBuilder.append(attributeValue);
//                stringBuilder.append("\n\n");
//            }
//        eventType = pullParser.next();//读取下一个标签
//    }
}